package com.webmall.servlet.pages;

import com.webmall.entity.CateEntity;
import com.webmall.service.webmall_CateDao;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;

@WebServlet("/indexSelect")
public class indexSelect extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        ArrayList<CateEntity> fatherList = webmall_CateDao.showCate("father");
        request.setAttribute("fatherList",fatherList);

        ArrayList<CateEntity> childList = webmall_CateDao.showCate("child");
        request.setAttribute("childList",childList);

        request.getRequestDispatcher("index.jsp").forward(request,response);


    }
}
